{% load dajaxice_templatetags %}
{% dajaxice_js_import %}
<script src="/common/custom/jquery-ui/js/jquery-1.8.3.js"></script>
<script src="/common/dajax/jquery.dajax.core.js"></script>
<script src="/common/custom/bootstrap_completer/bootstrap.js"></script>
<script type="text/javascript">
   $(function() {
    var year__lte =  int
    var year__gte =  int
    var price__lte=  int
    var price__gte = int
    var category   = int
    var sort       = int


    var authors = []
    var names   = []

    function author_callback(data){
        authors = data.authors
        names   = data.names
    }

q = {'author':$('#author').val(),
     'name'  :$('#name').val()}

$('#authorsн
    ').typeahead({
    source: function (query, process) {
        Dajaxice.goodies.hello(my_callback,{'text':query})
        return window[this.attr('id')]},
    minLength: 3
    })

$('#names').typeahead({
    source: function (query, process) {
        this.attr('id')
        Dajaxice.goodies.hello(my_callback,{
            'field':query})
        return names},
    minLength: 3
    })

    
})
     
function send_form(){
    Dajaxice.examples.send_form(Dajax.process,{'form':$('#my_form').serialize(true)});
}

</script>

<form action="" method="get" id="my_form" accept-charset="utf-8">
    {{ form.as_p }}
    <p><input type="button" value="Send" onclick="send_form();"></p>
</form>



<select onchange="Dajaxice.goodies.updatecombo(Dajax.process, {'option':this.value})" size="1">

    <option value="0">Select...</option>
    <option value="0">Spain</option>
    <option value="1">France</option>
    <option value="2">United Kingdom</option>
</select>
<select id="combo2" onchange="" size="1"></select>

